echo "Setting up project dependencies..."
mkdir -p ./bin ./lib ./libinc ./dep ./obj
for dep in $*
do
    if [ -d "../$dep" ];
    then
        if [ -d "../$dep/bin" ]
        then
            if [ "$(ls -A ../$dep/bin/*.so 2>/dev/null)" ]
            then
                cp -u ../$dep/bin/*.so ./bin
            fi
        fi
        if [ -d "../$dep/lib" ]
        then
            if [ "$(ls -A ../$dep/lib/*.a 2>/dev/null)" ]
            then
                cp -u ../$dep/lib/*.a ./lib
            fi
        fi
        if [ -d "../$dep/inc" ]
        then
            cp -r -u ../$dep/inc/* ./libinc
        fi
        if [ -d "../$dep/include" ]
        then
            cp -r -u ../$dep/include/* ./libinc
        fi
    else
        echo "Dependency $dep not found. clone it first."
    fi
done